package com.xjj.service.controller;

import com.xjj.entity.ResponseEntity;
import com.xjj.service.service.SmsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/auth/api/sms")
@Api(tags = "发送短信验证码")
public class ApiSmsController {
    @Autowired
    private SmsService smsService;

    @Autowired
    private RedisTemplate<String, Object> redisTemplate;

    @ApiOperation("发送短信验证码")
    @GetMapping("/{tel}")
    public ResponseEntity<String> send(@PathVariable("tel") String tel) {

        smsService.send(tel);

        return ResponseEntity.SUCCESS("短信发送成功", null);
    }
}
